<?php

class SmerPeer extends BaseSmerPeer
{
  public static $tip = array('redovni' => 1, 'kombinovani' => 2, 'grupni' => 3);

  public static function getTips()
  {
    return array_flip(self::$tip);
  }

  public static function getIzbornis()
  {
     $smer_dbs = DbFinder::from('Smer')->leftJoin('Smer.Naziv', 'Predmet.Predmet')->withColumn('Predmet.PredmetNaziv', 'NazivPredmeta')->where('Smer.Tip', SmerPeer::$tip['grupni'])->find();
     $smer = array();
     foreach($smer_dbs as $smer_db)
       $smer[$smer_db->getId()] = $smer_db->getColumn('NazivPredmeta');

     return $smer;
    }

}